<?php
/**
 * @file
 * Common include file for Facebook applications.
 *
 * Declares and defines constants, global variables, functions, etc. which are
 * usable in all Facebook applications.
 *
 * Usage:
 *  - A page that wants to use Facebook APIs (e.g. Facebook's PHP client
 *    library, XFBML, FBJS, etc.) should include/require this page once and only
 *    once.
 *
 * Parameter(s):
 *  - $PATH_EXTERNAL : Relative path from the calling page to the 'external'
 *                     directory (e.g. '../external/').
 *
 * Global variable(s) set:
 *  - None.
 *
 * Global variable(s) unset:
 *  - None.
 *
 * Exception(s):
 *  - None.
 *
 * This file includes/requires:
 *  - facebook.php (The Facebook PHP client library.)
 */

// header file(s) ==============================================================
require_once $PATH_EXTERNAL . "facebook-platform/php/facebook.php";


// constant(s) =================================================================
// general ---------------------------------------------------------------------
//! Maximum length of a Facebook 'User ID' (64-Bit Int).
define("FB_LENGTH_USER_ID", 20);

// XFBML -----------------------------------------------------------------------
//! Facebook XFBML doctype.
define(
  "FB_XFBML_DOCTYPE",
  'html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'
  . ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"'
);
//! Facebook XFBML XML namespace.
define(
  "FB_XFBML_XMLNS",
  'xmlns="http://www.w3.org/1999/xhtml"'
  . ' xmlns:fb="http://www.facebook.com/2008/fbml"'
);

// FBJS ------------------------------------------------------------------------
//! Facebook JavaScript 'Feature Loader'.
define(
  "FB_JS_FEATURE_LOADER",
  "http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"
);
//! Facebook JavaScript 'Cross-Domain Receiver'.
define(
  "FB_JS_XDOMAIN_RECEIVER",
  $PATH_EXTERNAL . "facebook-platform/js/xd_receiver.htm"
);

// PHP support -----------------------------------------------------------------
//! Exception message for failure to create the 'Facebook' object.
define("FB_EX_MSG_FACEBOOK", "Failed to connect to Facebook.");
//! Exception message for failure to get the current user's Facebook 'User ID'.
define("FB_EX_MSG_USER_ID", "Failed to identify Facebook User.");
?>
